<?php

  // rme added
  $EmployeeUid = $_SESSION["EMPLOYEE"];
  // rme end

  try {  	

  $G_MAIN_MENU = 'processmaker';
  $G_SUB_MENU = 'hr/menuhrEmployee';
  $G_ID_MENU_SELECTED = 'ID_HR_EMP';
  $G_ID_SUB_MENU_SELECTED = 'ID_HR_EMPLOYEE_BENEFIT';

  $G_PUBLISH = new Publisher;

  require_once ( PATH_PLUGINS . 'hr' . PATH_SEP . 'class.hr.php');
  $pluginObj = new hrClass ();

  // rme added
  include( PATH_PLUGINS . 'hr' . PATH_SEP . 'submenuhrMyinfo.inc.php' );

  require_once ( "classes/model/HrEmployee.php" );
  $tr = HrEmployeePeer::retrieveByPK( $EmployeeUid  );
  
  if ( ( is_object ( $tr ) &&  get_class ($tr) == 'HrEmployee' ) ) {
    $fields00['EMPLOYEEFIRSTNAME'] = $tr->getEmployeelastname() . ", " . $tr->getEmployeefirstname() . " " . $tr->getEmployeemiddlename();
    $fields00['EMPLOYEESSN'] = $tr->getEmployeessn();
  } else
    $fields00 = array();

  $G_PUBLISH->AddContent('xmlform', 'xmlform', 'hr/hrEmployeeView', '', $fields00, '' );
  // rme end

  require_once ( "classes/model/HrEmployeeBenefit.php" );

  $Criteria = new Criteria('workflow');
  $Criteria->clearSelectColumns ( );
  
  $Criteria->addSelectColumn (  HrEmployeeBenefitPeer::EMPLOYEEBENEFIT_UID );
  $Criteria->addSelectColumn (  HrEmployeeBenefitPeer::EMPLOYEE_ID );
  $Criteria->addSelectColumn (  HrEmployeeBenefitPeer::BENEFIT_ID );
  $Criteria->addSelectColumn (  HrEmployeeBenefitPeer::JOBNUMBER );

  $Criteria->add (  hrEmployeeBenefitPeer::EMPLOYEEBENEFIT_UID, "xx" , CRITERIA::NOT_EQUAL );
  
  // rme added
  $Criteria->add (  hrEmployeeBenefitPeer::EMPLOYEE_ID, $EmployeeUid , CRITERIA::EQUAL );
  $fields["EMPLOYEE"] = $EmployeeUid;
  // rme end
  
  // rme changes
  $G_PUBLISH->AddContent('propeltable', 'paged-table', 'hr/hrEmployeeBenefitListSS', $Criteria , $fields,'', '../../gulliver/propelTableAjax');
  // rme end

  G::RenderPage('publish', 'blank');

  }
  catch ( Exception $e ) {
    $G_PUBLISH = new Publisher;
    $aMessage['MESSAGE'] = $e->getMessage();
    $G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
    G::RenderPage( 'publish', 'blank' );
  }      
